package com.cwz.seata.demo1.controller;


import com.cwz.seata.demo1.service.SeataDemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Wen
 * @since 2023-10-08
 */
@RestController
@RequestMapping("/seata-demo")
public class SeataDemoController {
	@Autowired
	private SeataDemoService seataDemoService;

	@PutMapping("/upd/num/{id}")
	public int updateNum(@PathVariable("id") Long id) {
		return this.seataDemoService.updateNum(id);
	}

	@PutMapping("/upd/price/{id}")
	public int updatePrice(@PathVariable("id") Long id) {
		return this.seataDemoService.updatePrice(id);
	}

	@PostMapping("/add")
	public int addSeataDemo() {
		return this.seataDemoService.addSeataDemo();
	}
}

